<?php
/*
Plugin Name: DMQ_RSS_feed_plugin
Plugin URI: http://www.cedeskog.com/fbapp/wp
Description: The plugin to pull down XML/RSS from a url and convert it into SimpleXMLElement.
Version: 1.0
Author: DMQ Solutions
Author URI: http://www.cedeskog.
License: Licensed to DMQ 2011
*/

require_once('classes/scrape.php');

function GetDmqRss() {

	$scrape = new Scrape;
	$xml = $scrape->GetRSS("http://feeds.feedburner.com/Feber");
	$html = '';

	if ( is_object( $xml ) && get_class( $xml ) == "SimpleXMLElement" ) {
		foreach ( $xml->channel->item as $item ) {
    		$html .= "<article>";
				$html .= "<header><h1><a href='" . $item->guid . "'>".$item->title."</a></h1></header>";
				$html .= "<section>" . $item->description . "</section>";
			$html .= "</article>";
		}
	} else {
		$html .= '<p>Kunde inte hämta rss-feed.</p>';
	}
	
	return $html;
}